﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using DevExpress.Mvvm;
using orm.Models;

namespace OneStress.PropertyNodes
{
    internal class WellBoreNode : PropertyNode<TgsTDWellBore>
    {
        public WellBoreNode(Guid id)
        {
            var dbContext = ServiceContainer.Default.GetService<IDisposable>("DBSerice") as OneSysDBContext;
            _current = dbContext.TgsTDWellBore.Where(v => v.WellboreId == id.ToString()).SingleOrDefault();
        }

        [Category("General")]
        public override string Name
        {
            get
            {
                return _current?.WellboreName;
            }
            set
            {
                _current.WellboreName = value;
            }
        }




    }
}
